#include <stdio.h>
#pragma pack(16)
struct BBB {
    long num;
    char ha;
    short ba[5];
    struct BBB2
    {
        int s; //4
        int ba2[5]; //20 
        char ha2[2]; //2
    }b2;  //4+20+2=26。对齐=4的倍数=28 
}b;

int main() {
    printf("%d\n", sizeof(b.num));//8
    printf("%d\n", sizeof(b.ha)); //1
    printf("%d\n", sizeof(b.ba)); //10 ,short大小是2
    printf("%d\n",sizeof(b.b2));//28，见上面
    //最大对齐数是8

    printf("%d\n", sizeof(BBB));
    return 0;
}
//sizeof(BBB)=8+1+1+(2*5)=20，后面嵌套的BBB2最大对齐数是4，对齐大小是28，所以从4的倍数出发，这里是20开始，正好，sizeof(BBB)=20+28=48，正好是8的倍数

